﻿
/*----------------------------------------------------------------//
// 文件名：MoTuser.cs
// 文件功能描述：实体 MoTuser.
// 
// 创建标识：2009-02-27
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoTuser
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoTuser
	/// </summary>
	public partial class MoTuser:ICloneable
	{
		#region 表Tuser的字段
		private string _uid;
		private string _emp_id;
		private string _display_name;
		private string _pwd;
		private int _status;
		private DateTime _create_time;
		private DateTime _update_time;
		#endregion
		
		#region 构造函数
		public MoTuser()
		{
		    
		    
		    
		    
		    
		    _create_time= DateTime.Now;
		    _update_time= DateTime.Now;
		}
		#endregion
		
		#region 拷贝构造函数

		public MoTuser(MoTuser item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoTuser(string uid,string emp_id,string display_name,string pwd,int status,DateTime create_time,DateTime update_time)
		{
		this._uid=uid;
		this._emp_id=emp_id;
		this._display_name=display_name;
		this._pwd=pwd;
		this._status=status;
		this._create_time=create_time;
		this._update_time=update_time;
		}
		#endregion
		
		#region 表Tuser的字段属性
		/// <summary>
		///用户ID默认等于人员编码。如：   人员序号1，人员编码 E0001,姓名 张明   对应用户表 的用户ID就是E0001.
		/// </summary>
		public string Uid
		{
			get {return _uid;}
			set {_uid=value;}
		}
		/// <summary>
		///人员序号是自增序列。人员编码使用触发器实现   E0001,E0002
		/// </summary>
		public string Emp_Id
		{
			get {return _emp_id;}
			set {_emp_id=value;}
		}
		/// <summary>
		/// DISPLAY_NAME
		/// </summary>
		public string Display_Name
		{
			get {return _display_name;}
			set {_display_name=value;}
		}
		/// <summary>
		/// PWD
		/// </summary>
		public string Pwd
		{
			get {return _pwd;}
			set {_pwd=value;}
		}
		/// <summary>
		///2表示该用户是正常用户，-1表示被删除。0表示被禁用。默认为2.
		/// </summary>
		public int Status
		{
			get {return _status;}
			set {_status=value;}
		}
		/// <summary>
		/// CREATE_TIME
		/// </summary>
		public DateTime Create_Time
		{
			get {return _create_time;}
			set {_create_time=value;}
		}
		/// <summary>
		/// UPDATE_TIME
		/// </summary>
		public DateTime Update_Time
		{
			get {return _update_time;}
			set {_update_time=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoTuser CopyTo(MoTuser item)
        {
		    item.Uid=this.Uid;
		    item.Emp_Id=this.Emp_Id;
		    item.Display_Name=this.Display_Name;
		    item.Pwd=this.Pwd;
		    item.Status=this.Status;
		    item.Create_Time=this.Create_Time;
		    item.Update_Time=this.Update_Time;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoTuser NewTuser=new MoTuser();
		    NewTuser._uid=this._uid;
		    NewTuser._emp_id=this._emp_id;
		    NewTuser._display_name=this._display_name;
		    NewTuser._pwd=this._pwd;
		    NewTuser._status=this._status;
		    NewTuser._create_time=this._create_time;
		    NewTuser._update_time=this._update_time;
			return NewTuser;
		}
		
		private static MoTuser _empty = new MoTuser(string.Empty,string.Empty,string.Empty,string.Empty,-1,DateTime.MinValue,DateTime.MinValue);
        public static MoTuser Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoTuser NewTuser = obj as MoTuser;
                if (NewTuser == null)
                {
                    return false;
                }
                else
                {
				if (NewTuser.Uid==this.Uid && NewTuser.Emp_Id==this.Emp_Id && NewTuser.Display_Name==this.Display_Name && NewTuser.Pwd==this.Pwd && NewTuser.Status==this.Status && NewTuser.Create_Time==this.Create_Time && NewTuser.Update_Time==this.Update_Time)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Uid={0}/Emp_Id={1}/Display_Name={2}/Pwd={3}/Status={4}/Create_Time={5}/Update_Time={6}",_uid,_emp_id,_display_name,_pwd,_status,_create_time,_update_time);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["UID"]!=null && row["UID"]!=DBNull.Value)
			{
			    this.Uid = (string)row["UID"];
			}
			else
			{
				this.Uid =string.Empty;
			}
		    if(row["Emp_ID"]!=null && row["Emp_ID"]!=DBNull.Value)
			{
			    this.Emp_Id = (string)row["Emp_ID"];
			}
			else
			{
				this.Emp_Id =string.Empty;
			}
		    if(row["Display_Name"]!=null && row["Display_Name"]!=DBNull.Value)
			{
			    this.Display_Name = (string)row["Display_Name"];
			}
			else
			{
				this.Display_Name =string.Empty;
			}
		    if(row["PWD"]!=null && row["PWD"]!=DBNull.Value)
			{
			    this.Pwd = (string)row["PWD"];
			}
			else
			{
				this.Pwd =string.Empty;
			}
		    if(row["Status"]!=null && row["Status"]!=DBNull.Value)
			{
			    this.Status = (int)row["Status"];
			}
			else
			{
				this.Status =-1;
			}
		    if(row["Create_Time"]!=null && row["Create_Time"]!=DBNull.Value)
			{
			    this.Create_Time = (DateTime)row["Create_Time"];
			}
			else
			{
				this.Create_Time =DateTime.MinValue;
			}
		    if(row["Update_Time"]!=null && row["Update_Time"]!=DBNull.Value)
			{
			    this.Update_Time = (DateTime)row["Update_Time"];
			}
			else
			{
				this.Update_Time =DateTime.MinValue;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["UID"] = this.Uid;
			row["Emp_ID"] = this.Emp_Id;
			row["Display_Name"] = this.Display_Name;
			row["PWD"] = this.Pwd;
			row["Status"] = this.Status;
			row["Create_Time"] = this.Create_Time;
			row["Update_Time"] = this.Update_Time;
		}
		#endregion
	}
}
#endregion
